<?php

namespace app\admin\validate;

use think\Validate;

class SGoods extends Validate
{
    protected $rule = [
        'category_id'=>'require',
        'goods_name'=> 'require',
        'goods_unit'=> 'require',
        'goods_img'=> 'require',
        'logistics_mode'=> 'require',
        'order_num'=>'require|number',
        'status'=>["require","in"=>"0,1"]
    ];

    protected $message = [
        'category_id'=> '商品分类必须',
        'goods_name'=> '商品名称必须',
        'goods_unit'=> '商品单位必须',
        'goods_img'=> '商品轮播图必须',
        'logistics_mode'=> '物流方式必须',
        'order_num.require'=>'排序必须',
        'order_num.number'=>'排序必须为数字',
        'status.require'=>'状态必须',
        'status.in'=>'状态数值错误',
    ];
}
